<template>
	<view class="content">
		<view class="home_img">
			<image src="../../../static/img/homeImg.jpg" class="home_img"></image>
		</view>
		<view class="zt_top_bar">
			<view class="click_item" @click="qiandao">
				<view class="zt-bg-img">
					<image src="../../../static/img/qiandao.png"></image>
				</view>
				<view class="zt-title">签到</view>
			</view>
			<view class="click_item" @click="jianbao">
				<view class="zt-bg-img">
					<image src="../../../static/img/jianbao.png"></image>
				</view>
				<view class="zt-title">简报</view>
			</view>
			<view class="click_item" @click="saomiao">
				<view class="zt-bg-img">
					<image src="../../../static/img/saomiao.jpg"></image>
				</view>
				<view class="zt-title">扫一扫</view>
			</view>
		</view>
		<view class="zt-hot-dot">
			<view class="zt-current-affairs-title">
				热点
			</view>
			<zt-list></zt-list>
			<zt-list></zt-list>
			<zt-list></zt-list>
			<zt-list></zt-list>
			<zt-list></zt-list>
		</view>
		
		<Message v-if="isMessage" :msgText="msgText"></Message>
	</view>
</template>

<script>
	import Message from "../../../commpons/Message.vue"
	import ztList from '../../../commpons/zt-list.vue'
	import uniPopup from "@/lib/components/uni-popup/uni-popup.vue"
	export default {
		data() {
			return { 
				isMessage:false,
				msgText:"登录成功"
			}
		},
		onLoad() {

		},
		onPullDownRefresh() {
			setTimeout(function(){ 
				uni.stopPullDownRefresh();
			},1000)
			
		},
		methods: {
			qiandao() {
				uni.navigateTo({
					url: "../../user_sign/user_sign"
				})
			},
			jianbao() {
				uni.navigateTo({
					url:"../../jianbao/jianbao"
				})
			},
			saomiao() {
				let that = this;
				uni.scanCode({ //扫描  具体功能我也不知道
					success(res) {
						uni.navigateTo({
							url:"../../web_view/web_view?webUrl="+res.result
						})
						// that.webUrl = res.result;
						// that.showWebView = true;
						// plus.runtime.openURL(res.result);  //H5+  的runtime 文档 跳向外部链接
						// console.log(res);
						// console.log('条码类型：' + res.scanType);
						// console.log('条码内容：' + res.result);
					}
				})
			}
		},
		components: {
			ztList,
			uniPopup,
			Message
		}
	}
</script>

<style lang="scss">
	.content {
		width: 100%;
		display: flex;
		flex-direction: column;
		justify-content: center;
	}

	.home_img {
		margin: 0 auto;
		height: 300rpx;
	}

	.zt_top_bar {
		padding-top: 20rpx;
		padding-bottom: 20rpx;
		width: 100%;
		display: flex;
		flex-direction: row;
		justify-content: center;
		background: #FFFFFF;
	}

	.zt-bg-img {
		width: 100rpx;
		height: 100rpx;
		border-radius: 50%;
		position: relative;
	}

	.click_item {
		text-align: center;
	}

	.zt_top_bar .click_item:nth-child(2) {
		margin-left: 120rpx;
		margin-right: 120rpx;
	}

	.zt-title {
		font-size: 12px;
	}

	.zt_top_bar .click_item .zt-bg-img image {
		width: 80rpx;
		height: 80rpx;
		position: absolute;
		left: 50%;
		top: 50%;
		transform: translate(-50%, -50%);
	}

	.zt-current-affairs-title {
		padding: 30rpx;
		border-bottom: 1rpx solid #cccccc;
		border-top: 1rpx solid #cccccc;
	}
</style>
